package com.tuocent.dagv2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tuocent.dagv2.entity.Projects;
import com.tuocent.dagv2.service.IArchivesService;
import com.tuocent.dagv2.service.IProjectsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import java.util.List;

@Service
public class ArchivesServiceImpl implements IArchivesService {
    @Autowired
    public IProjectsService projectsService;

    @Override
    public String archivesInfo(Model model) {
        List<Projects> projectsList = projectsService.list(new QueryWrapper<Projects>()
                .eq("is_del", "0"));
        model.addAttribute("projectsList", projectsList);
        return "/archives/archivesInfo";
    }

    @Override
    public String archivesHome(Model model) {
        return "/archives/archivesHome";
    }

    @Override
    public String archivesFile(Model model, String pid, String tid, String classId) {
        model.addAttribute("pid", pid);
        model.addAttribute("tid", tid);
        model.addAttribute("classId", classId);
        return "/archives/archivesFile";
    }
}
